import request from "@/utils/request";
import type { GetVipResponseType, VipDetailType } from "./types";

/**
 * 请求获取会员分页列表
 * @param page
 * @param limit
 * @param keyword
 * @returns
 */
export const reqGetVipList = (page: number, limit: number, keyword: string) => {
  return request.get<null, GetVipResponseType>(
    `/admin/user/${page}/${limit}?keyword=${keyword}`
  );
};

/**
 * 请求获取详细页面数据
 * @param userId
 * @returns
 */
export const reqGetVipDetail = (userId: number) => {
  return request.get<null, VipDetailType>(`/admin/user/show/${userId}`);
};

/**
 * 请求解锁和上锁
 * @param userId
 * @param status
 * @returns
 */
export const reqSetLock = (userId: number, status: number) => {
  return request.get(`/admin/user/lock/${userId}/${status}`);
};
